package com.crm.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.crm.base.ResponseResult;
import com.crm.domain.dto.ActivityChannelStatType;
import com.crm.domain.entity.ActivityChannelStat;
import com.crm.service.ActivityChannelStatService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/report/activityStatisticsList")
@RequiredArgsConstructor
public class ActivityChannelStatController {

    private final ActivityChannelStatService activityChannelStatService;

    @GetMapping
    @ApiOperation( "获取活动渠道统计列表")
    public ResponseResult getByPage(ActivityChannelStatType activityChannelStatType){
        Page<ActivityChannelStat> page = activityChannelStatService.getByPage(activityChannelStatType);
        return ResponseResult.success().put("total",page.getTotal()).put("rows",page.getRecords());

    }

}
